<cfif not isDefined("menu")>
	<cf_JelCMS4_Menu	navId = "#navId#"
						datasourcename = "#datasourcename#">
</cfif>
<cfoutput>
<cfset displaySubs = 0>
<cfset beyondFirst = false>
<cfset lastlevel = 0>
<cfloop index="i" from="1" to="#ArrayLen(menu)#">

	<cfif ListGetAt(parentIdList, 2) eq menu[i].navigationid>
	<cfelseif displaySubs and menu[i].level eq 2>
		<cfbreak>
	</cfif>
	
	<cfif displaySubs eq 1 and menu[i].isvisible>
		<cfif menu[i].level eq 3>
			<cfif beyondFirst>
				<div class="subnavitemseparator"><img src="/common/images/spacer.gif" width="1" height="1" alt="" border="0"></div>
			</cfif>
			
			<cfif ListFind(parentIdList, menu[i].navigationId)>
				<a href="/index.cfm?navId=#menu[i].navigationId#" class="subnavItemOn">#menu[i].name#</a>
			<cfelse>
				<a href="/index.cfm?navId=#menu[i].navigationId#" class="subnavItem">#menu[i].name#</a>
			</cfif>
			
			<cfset lastlevel = menu[i].level>
			<cfset beyondFirst = true>
		<cfelseif menu[i].level eq 4 and ListFind(parentIdList, menu[i].parentId)>
		
			<cfif ListFind(parentIdList, menu[i].navigationId)>
				<a href="/index.cfm?navId=#menu[i].navigationId#" class="tertiarynavitemOn">#menu[i].name#</a>
			<cfelse>
				<a href="/index.cfm?navId=#menu[i].navigationId#" class="tertiarynavitem">#menu[i].name#</a>
			</cfif>
	
			<cfset lastlevel = menu[i].level>
		</cfif>
	</cfif>
	
	<cfif menu[i].navigationId eq ListGetAt(parentIdList, 2) and menu[i].isvisible>
		<cfset displaySubs = 1>
	</cfif>

</cfloop>
<cfif beyondFirst>
	<div class="subnavitemseparator"><img src="/common/images/spacer.gif" width="1" height="1" alt="" border="0"></div>
</cfif>

</cfoutput>